{// 引入标签库 }
<tagLib name="html" />
{// 加载头部公共文件 }
<include file="Public:header" />
<!-- 菜单区域  -->
<script language="JavaScript">
<!--
function checkInfo(){
	if($('productId').value==0){
		alert('请选择要购买的产品!');
		return false;
	}
	if($('teachId').value==0){
		alert('请选择技师!');
		return false;
	}
	if(trim($('room').value)==""){
		alert('请填写房间号!');
		return false;
	}
	if(trim($('consumeTime').value)==""){
		alert('请填写时间!');
		return false;
	}
	return true;
}

function setProductlogId(){
	$('plId').value=$('productId')[$('productId').selectedIndex].id;
}
//-->
</script>
<!-- 主页面开始 -->
<div id="main" class="main" >

<!-- 主体内容  -->
<div class="content" >
<div class="title" style="text-align:center">[ 今日消费 ]</div>
<!--  功能操作区域  -->
<div class="operate" style="display:none" >
<html:imageBtn name="add" value="新增" click="add()" style="impBtn hMargin fLeft shadow" />
<!-- <html:imageBtn name="edit" value="编辑" click="edit()" style="impBtn hMargin fLeft shadow" /> -->
<html:imageBtn name="delete" value="删除" click="foreverdel()" style="impBtn hMargin fLeft shadow" />
<!-- 查询区域 -->
<div class="fRig">
<form method='post' action="__URL__">
</div>
<!-- 高级查询区域 -->
<div  id="searchM" class=" none search cBoth" >
<table cellpadding="1" cellspacing="3" width="100%">
<tr>
	<td class="tRight">卡序列号:</td>
	<td class="tLeft"><input type="text" name="cardSerial" class="medium"></td>
	<td class="tRight">真实姓名：</td>
	<td><input type="text" name="trueName" class="medium"/></td>
	<td class="tRight">手机号码：</td>
	<td ><input type="text" name="telphone" class="medium"></td>
</tr>
</table>
</div>
<div class="fLeft"><span id="key"><input type="text" name="cardNumber" title="帐号查询" class="medium" ></span></div>
<html:imageBtn type="submit" name="search" value="查询" style="impBtn hMargin fLeft shadow" />
<html:imageBtn name="adv" value="高级" id="showText" click="showHideSearch()" style="impBtn hMargin fLeft shadow" />
</form>
</div>
<!-- 功能操作区域结束 -->

<!-- 列表显示区域  -->
<div class="list" >
	<table id="checkList" class="list" cellpadding=0 cellspacing=0>
	<tr><td height="5" colspan="6" class="topTd" ></td></tr>
		<tr class="row" align="center">
			<th width="4%"><input type="checkbox" id="check" onclick="CheckAll('checkList')"></th>
			<th>编号</th>
			<th>产品名</th>
			<th>技师</th>
			<th>房间号</th>
			<th>时间</th>
		</tr>
		<if condition="$consumelog">
		<volist name="consumelog" id="log">
			<tr class="row" onmouseover="over(event)" onmouseout="out(event)" align="center">
				<td><input type="checkbox" name="key"	value="{$log.id}"></td>
				<td>{$log.id}</td>
				<td>
					<volist name="products" id="p">
						<if condition="$p['id'] eq $log['productId']" >
							{$p.name}
						</if>
					</volist>
				</td>
				<td>
					<volist name="teach" id="t">
						<if condition="$t['id'] eq $log['teachId']" >
							{$t.nickname}
						</if>
					</volist>
				</td>
				<td>{$log.room}</td>
				<td>{$log.consumeTime}</td>
			</tr>
		</volist>
		<else/>
			<tr class="row"><td colspan="6" align="center">今日暂无记录,请在下面添加</td></tr>
		</if>
		<tr><td height="5" colspan="6" class="bottomTd"></td></tr>
	</table>
	<table width="99%" style="border:1px #CCC solid" >
	<form action="__URL__/add" method="get" onsubmit="return checkInfo();">
		<tr class="row"><th colspan="9" >添加消费</th></tr>
		<tr>
			<td class="tleft" >产品:</td>
			<td class="tleft" >
				<if condition="$productlog">
					<SELECT class="medium bLeft"  name="productId" id="productId" onchange="setProductlogId();">
						<option value="0">请选择产品</option>
						<volist name="productlog" id="plog">
							<option id="{$plog.id}" value="{$plog.productId}">{$plog.productName}/{$plog.useTimes}/{$plog.usedTimes}</option>
						</volist>
					</SELECT>&nbsp;&nbsp;<a href="__APP__/Productlog/add/cardId/{$card.id}/fff">购买</a>
				<else />
					无可用产品,请先<a href="__APP__/Productlog/add/cardId/{$card.id}/fffff">购买</a>
				</if>
			</td>
			<td class="tleft">技师:</td>
			<td class="tleft" >
				<SELECT class="medium bLeft"  name="teachId" id="teachId">
						<option value="0">请选择技师</option>
						<volist name="teach" id="t">
							<option value="{$t.id}">{$t.nickname}</option>
						</volist>
					</SELECT>
			</td>
			<td class="tleft">房间号:</td>
			<td class="tleft"><input type="text" id="room" name="room"></td>
			<td class="tleft">时间:</td>
			<input type="hidden" name="memberId" value="{$card.memberId}">
			<input type="hidden" name="plId" id="plId" value="">
			<td class="tleft" ><input type="text" name="consumeTime"  id="consumeTime"/></td>
			<td class="tleft"><input type="submit" value="添加"  class="small button"></td>
		</tr>
		<tr><td height="5" colspan="9" class="bottomTd"></td></tr>
		</form>
	</table>
</div>
<!--  分页显示区域 -->
<div class="page">
	<div class="fLeft"><input type="button" value="返回" onclick="window.location='__APP__/Member/showInfo/id/{$card.memberId}/ffff';" class="small button"></div>
{$page}</div>
<!-- 列表显示区域结束 -->
</div>
<!-- 主体内容结束 -->
</div>
<!-- 主页面结束 -->
